<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  GHC.GHCi</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2012</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  see libraries/base/LICENSE</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  cvs-ghc@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  internal</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  non-portable (GHC Extensions)</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- The GHCi Monad lifting interface.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- EXPERIMENTAL! DON'T USE.</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.GHCi</span><span> </span><span class="hs-pragma">{-# WARNING</span><span> </span><span class="hs-pragma">&quot;This is an unstable interface.&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.GHCi.html#GHCiSandboxIO"><span class="hs-identifier">GHCiSandboxIO</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier">NoIO</span></a></span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier">IO</span></a></span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier">Monad</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier">Functor</span></a></span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#fmap"><span class="hs-identifier">fmap</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier">Applicative</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator">(&gt;&gt;=)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#id"><span class="hs-identifier">id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#."><span class="hs-operator">(.)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#ap"><span class="hs-identifier">ap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-comment">-- | A monad that can execute GHCi statements by lifting them out of</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- m into the IO monad. (e.g state monads)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">class</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562228"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="GHCiSandboxIO"><span class="annot"><a href="GHC.GHCi.html#GHCiSandboxIO"><span class="hs-identifier hs-var">GHCiSandboxIO</span></a></span></span><span> </span><span id="local-6989586621679562228"><span class="annot"><a href="#local-6989586621679562228"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-29"></span><span>    </span><span id="local-6989586621679562227"><span id="ghciStepIO"><span class="annot"><a href="GHC.GHCi.html#ghciStepIO"><span class="hs-identifier hs-type">ghciStepIO</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679562228"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562227"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562227"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-comment">-- | @since 4.4.0.0</span><span>
</span><span id="line-32"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.GHCi.html#GHCiSandboxIO"><span class="hs-identifier hs-type">GHCiSandboxIO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-33"></span><span>    </span><span id="local-6989586621679562167"><span class="annot"><span class="annottext">ghciStepIO :: forall a. IO a -&gt; IO a
</span><a href="GHC.GHCi.html#ghciStepIO"><span class="hs-identifier hs-var hs-var hs-var hs-var">ghciStepIO</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO a
forall a. a -&gt; a
</span><a href="GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-comment">-- | A monad that doesn't allow any IO.</span><span>
</span><span id="line-36"></span><span class="hs-keyword">newtype</span><span> </span><span id="NoIO"><span class="annot"><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-var">NoIO</span></a></span></span><span> </span><span id="local-6989586621679562224"><span class="annot"><a href="#local-6989586621679562224"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="NoIO"><span class="annot"><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-var">NoIO</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="noio"><span class="annot"><span class="annottext">forall a. NoIO a -&gt; IO a
</span><a href="GHC.GHCi.html#noio"><span class="hs-identifier hs-var hs-var">noio</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562224"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-comment">-- | @since 4.8.0.0</span><span>
</span><span id="line-39"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679562162"><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-type">NoIO</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-40"></span><span>  </span><span id="local-6989586621679562158"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; NoIO a -&gt; NoIO b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679562157"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679562157"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-type">NoIO</span></a></span><span> </span><span id="local-6989586621679562156"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679562156"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO b -&gt; NoIO b
forall a. IO a -&gt; NoIO a
</span><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-var">NoIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; IO a -&gt; IO b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679562157"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679562156"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">-- | @since 4.8.0.0</span><span>
</span><span id="line-43"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679562146"><span id="local-6989586621679562148"><span id="local-6989586621679562150"><span class="annot"><a href="GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-type">NoIO</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-44"></span><span>  </span><span id="local-6989586621679562142"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; NoIO a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679562141"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679562141"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; NoIO a
forall a. IO a -&gt; NoIO a
</span><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-var">NoIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; IO a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679562141"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span>  </span><span id="local-6989586621679562139"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. NoIO (a -&gt; b) -&gt; NoIO a -&gt; NoIO b
</span><a href="GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;*&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoIO (a -&gt; b) -&gt; NoIO a -&gt; NoIO b
forall (m :: * -&gt; *) a b. Monad m =&gt; m (a -&gt; b) -&gt; m a -&gt; m b
</span><a href="GHC.Base.html#ap"><span class="hs-identifier hs-var">ap</span></a></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-comment">-- | @since 4.4.0.0</span><span>
</span><span id="line-48"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679562132"><span id="local-6989586621679562134"><span class="annot"><a href="GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-type">NoIO</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-49"></span><span>    </span><span id="local-6989586621679562129"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. NoIO a -&gt; (a -&gt; NoIO b) -&gt; NoIO b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">(&gt;&gt;=)</span></a></span></span><span> </span><span id="local-6989586621679562128"><span class="annot"><span class="annottext">NoIO a
</span><a href="#local-6989586621679562128"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679562127"><span class="annot"><span class="annottext">a -&gt; NoIO b
</span><a href="#local-6989586621679562127"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO b -&gt; NoIO b
forall a. IO a -&gt; NoIO a
</span><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-var">NoIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NoIO a -&gt; IO a
forall a. NoIO a -&gt; IO a
</span><a href="GHC.GHCi.html#noio"><span class="hs-identifier hs-var hs-var">noio</span></a></span><span> </span><span class="annot"><span class="annottext">NoIO a
</span><a href="#local-6989586621679562128"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (a -&gt; IO b) -&gt; IO b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">NoIO b -&gt; IO b
forall a. NoIO a -&gt; IO a
</span><a href="GHC.GHCi.html#noio"><span class="hs-identifier hs-var hs-var">noio</span></a></span><span> </span><span class="annot"><span class="annottext">(NoIO b -&gt; IO b) -&gt; (a -&gt; NoIO b) -&gt; a -&gt; IO b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; NoIO b
</span><a href="#local-6989586621679562127"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-comment">-- | @since 4.4.0.0</span><span>
</span><span id="line-52"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.GHCi.html#GHCiSandboxIO"><span class="hs-identifier hs-type">GHCiSandboxIO</span></a></span><span> </span><span class="annot"><a href="GHC.GHCi.html#NoIO"><span class="hs-identifier hs-type">NoIO</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-53"></span><span>    </span><span id="local-6989586621679562122"><span class="annot"><span class="annottext">ghciStepIO :: forall a. NoIO a -&gt; IO a
</span><a href="GHC.GHCi.html#ghciStepIO"><span class="hs-identifier hs-var hs-var hs-var hs-var">ghciStepIO</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoIO a -&gt; IO a
forall a. NoIO a -&gt; IO a
</span><a href="GHC.GHCi.html#noio"><span class="hs-identifier hs-var hs-var">noio</span></a></span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span></pre></body></html>